<template>
  <!-- <div>
    <ElInput
      v-if="state === 'edit'"
      v-bind="$attrs"
      v-model="model"
    ></ElInput>
    <span v-else>{{ model }}</span>
  </div> -->
  <ElInput></ElInput>
</template>

<script setup lang="ts">
import { computed, inject, ref } from 'vue';
import { ElInput } from 'element-plus';
import { easyTableContextKey } from './easy-table';

// const model = defineModel<string | number>();
const $props = defineProps({
  index: { type: Number, required: true },
});

const easyTableContext = inject(easyTableContextKey);
const state = computed(
  () => easyTableContext?.states.value[$props.index] || 'view'
);
</script>

<style scoped></style>
